/*
 * SASettings.cpp
 *
 *  Created on: 2010-06-04
 *      Author: NONO
 */

// System includes
#include <s32file.h>        // Stream && Store

// CLASS INCLUDE
#include "SASettings.h"



// ================= MEMBER FUNCTIONS =======================

CSASettings::~CSASettings()
{   
}

void CSASettings::Initial()
{
    SetAutoRun(ETrue);
    SetSneakMode(EFalse);
}

const TBool CSASettings::operator==(const CSASettings& aComparand)
{
    return iAutoRun == aComparand.iAutoRun && 
        iSneakMode == aComparand.iSneakMode;
}

const TBool CSASettings::operator!=(const CSASettings& aComparand)
{
    return !(*this == aComparand);
}

void CSASettings::SetAutoRun(TBool aAutoRun)
{
    iAutoRun = aAutoRun;
}

TBool& CSASettings::AutoRun()
{
    return iAutoRun;
}


void CSASettings::SetSneakMode(TBool aSneakMode)
{
    iSneakMode = aSneakMode;
}

TBool& CSASettings::SneakMode()
{
    return iSneakMode;
}

//====================================================
// CSASettings Implementation
//====================================================
void CSASettings::ExternalizeL(RWriteStream& aStream) const
{
    // Auto start
    aStream.WriteInt32L(iAutoRun);
    
    // Sneak mode
    aStream.WriteInt32L(iSneakMode);
}

void CSASettings::InternalizeL(RReadStream& aStream)
{
//    _LIT(COMMA,",");

    // Auto run
    iAutoRun = aStream.ReadInt32L();
    
    // Sneak mode
    iSneakMode = aStream.ReadInt32L();
}
